package unmsm.eapisw.taller.srh_persistencia.dao.impl;

import org.hibernate.SessionFactory;

import unmsm.eapisw.taller.srh_persistencia.dao.ITipoHabitacionDAO;
import unmsm.eapisw.taller.srh_persistencia.modelo.TipoHabitacion;

public class TipoHabitacionDAO implements ITipoHabitacionDAO{
	private SessionFactory sessionFactory;

	/**
	 * Get Hibernate Session Factory
	 * 
	 * @return SessionFactory - Hibernate Session Factory
	 */
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	/**
	 * Set Hibernate Session Factory
	 * 
	 * @param SessionFactory
	 *            - Hibernate Session Factory
	 */
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	
	public int addTipoHabitacion(TipoHabitacion th) {
		getSessionFactory().getCurrentSession().save(th);
		//getSessionFactory().getCurrentSession().persist(th);
		return th.getId();
	}

	public boolean updateTipoHabitacion(TipoHabitacion th) {
		getSessionFactory().getCurrentSession().update(th);
		return false;
	}

	public boolean deleteTipoHabitacion(TipoHabitacion th) {
		
		return false;
	}

}
